package com.example.myapplication.utils;

import org.apache.commons.pool2.impl.GenericObjectPoolConfig;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class RedisUtils {
    // 替换成你的reids地址和端口
    static String redisIp = "47.105.162.161";
    static int reidsPort = 6379;
    private final static JedisPool jedisPool = new JedisPool(new GenericObjectPoolConfig(), redisIp, reidsPort, 3000, "xzan",3);

    public static void publish(String content) {
        Jedis jedis = jedisPool.getResource();
        if (content != null && !"".equals(content))
        jedis.publish("tradeEvent", "sdfdff");
    }
}